#pragma once
#include "TimeDisplay.h"
#include "cstTime.h"

class CFontFactory;
class CNowDisplay :public CTimeDisplay
{
	DECLARE_DYNAMIC(CNowDisplay)

public:
	CNowDisplay();
	~CNowDisplay() override;

protected:
	DECLARE_MESSAGE_MAP()

public:
	void setTextColor(COLORREF clr);
	bool setTime(int h, int m, int s, int ms);
protected:
	CFontFactory *m_fFactory;
	COLORREF clrText;
	stNumBitmap nmTime[12], nmMs[10];	//0-9 : .
	CPoint nmTimePos[12], nmMsPos[10];
	CRect numRect[10];
	intptr_t numIndex[10];
	cst_Time time;
	bool displayChanged;

	void drawOut(intptr_t id, intptr_t n);
	void drawOutMs(intptr_t n);
};
